package com.dome.enumeration.tickets;

import org.apache.commons.lang3.StringUtils;

public enum IndicatorEnum {

    N("0","否"),
    Y("1","是"),
    ;

    private String code;

    private String desc;

    IndicatorEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDesc4Show(String code){
        if (StringUtils.isEmpty(code)){
            return "";
        }
        for (IndicatorEnum value : IndicatorEnum.values()) {
            if (value.getCode().equals(code)){
                return value.getDesc();
            }
        }
        return "";
    }

}
